home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ccccooooppppyyyyoooouuuutttt((((DDDD3333)))) ccccooooppppyyyyoooouuuutttt((((DDDD3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt - copy data from a driver buffer to a user buffer
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _iiii_nnnn_tttt _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt_((((_cccc_aaaa_dddd_dddd_rrrr______tttt _d_r_i_v_e_r_b_u_f_,,,, _cccc_aaaa_dddd_dddd_rrrr______tttt _u_s_e_r_b_u_f_,,,, _ssss_iiii_zzzz_eeee______tttt _c_o_u_n_t_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _d_r_i_v_e_r_b_u_f Driver source address from which copy is made.
-
- _u_s_e_r_b_u_f User destination address to which copy is made.
-
- _c_o_u_n_t Number of bytes to copy.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt copies _c_o_u_n_t bytes of data from the kernel virtual address
- specified by _d_r_i_v_e_r_b_u_f to the user virtual address specified by _u_s_e_r_b_u_f.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- On success, _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt returns 0. On failure, it returns -1 to indicate
- that the specified user address range is not valid.
-
- UUUUSSSSAAAAGGGGEEEE
- _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt chooses the best algorithm based on address alignment and number
- of bytes to copy. Although the source and destination addresses are not
- required to be word aligned, word aligned addresses may result in a more
- efficient copy.
-
- Drivers usually convert a return value of -1 into an _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT error.
-
- LLLLeeeevvvveeeellll
- Base only.
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- Can sleep.
-
- Driver-defined basic locks and read/write locks may not be held across
- calls to this function.
-
- Driver-defined sleep locks may be held across calls to this function.
-
- WWWWaaaarrrrnnnniiiinnnnggggssss
- The driver source buffer must be completely within the kernel address
- space, or the system can panic.
-
- When holding sleep locks across calls to this function, drivers must be
- careful to avoid creating a deadlock. During the data transfer, page
- fault resolution might result in another I/O to the same device. For
- example, this could occur if the driver controls the disk drive used as
- the swap device.
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- ccccooooppppyyyyoooouuuutttt((((DDDD3333)))) ccccooooppppyyyyoooouuuutttt((((DDDD3333))))
-
-
-
- EEEExxxxaaaammmmpppplllleeeessss
- A driver _iiii_oooo_cccc_tttt_llll(D2) routine (line 5) can be used to get or set device
- attributes or registers. If the specified command is _XXXX_XXXX______GGGG_EEEE_TTTT_RRRR_EEEE_GGGG_SSSS (line
- 9), the driver copies the current device register values to a user data
- area (line 11). If the user address is invalid, an error code is
- returned.
-
- _1111 _ssss_tttt_rrrr_uuuu_cccc_tttt _dddd_eeee_vvvv_iiii_cccc_eeee _{{{{ _////_**** _dddd_eeee_vvvv_iiii_cccc_eeee _rrrr_eeee_gggg_iiii_ssss_tttt_eeee_rrrr_ssss _llll_aaaa_yyyy_oooo_uuuu_tttt _****_////
- _...._...._....
- _2222 _iiii_nnnn_tttt _ssss_tttt_aaaa_tttt_uuuu_ssss_;;;; _////_**** _dddd_eeee_vvvv_iiii_cccc_eeee _ssss_tttt_aaaa_tttt_uuuu_ssss _wwww_oooo_rrrr_dddd _****_////
- _3333 _}}}}_;;;;
- _4444 _eeee_xxxx_tttt_eeee_rrrr_nnnn _ssss_tttt_rrrr_uuuu_cccc_tttt _dddd_eeee_vvvv_iiii_cccc_eeee _xxxx_xxxx______dddd_eeee_vvvv_[[[[_]]]]_;;;; _////_**** _pppp_hhhh_yyyy_ssss_iiii_cccc_aaaa_llll _dddd_eeee_vvvv_iiii_cccc_eeee _rrrr_eeee_gggg_iiii_ssss_tttt_eeee_rrrr_ssss _****_////
- _...._...._....
- _5555 _xxxx_xxxx_iiii_oooo_cccc_tttt_llll_((((_dddd_eeee_vvvv______tttt _dddd_eeee_vvvv_,,,, _iiii_nnnn_tttt _cccc_mmmm_dddd_,,,, _vvvv_oooo_iiii_dddd _****_aaaa_rrrr_gggg_,,,, _iiii_nnnn_tttt _mmmm_oooo_dddd_eeee_,,,, _cccc_rrrr_eeee_dddd______tttt _****_cccc_rrrr_pppp_,,,, _iiii_nnnn_tttt _****_rrrr_vvvv_pppp_))))
- _6666 _{{{{
- _7777 _ssss_tttt_rrrr_uuuu_cccc_tttt _dddd_eeee_vvvv_iiii_cccc_eeee _****_dddd_pppp_;;;;
- _8888 _ssss_wwww_iiii_tttt_cccc_hhhh _((((_cccc_mmmm_dddd_)))) _{{{{
- _9999 _cccc_aaaa_ssss_eeee _XXXX_XXXX______GGGG_EEEE_TTTT_RRRR_EEEE_GGGG_SSSS_:::: _////_**** _cccc_oooo_pppp_yyyy _dddd_eeee_vvvv_iiii_cccc_eeee _rrrr_eeee_gggg_iiii_ssss_tttt_eeee_rrrr_ssss _tttt_oooo _uuuu_ssss_eeee_rrrr _pppp_rrrr_oooo_gggg_rrrr_aaaa_mmmm _****_////
- _1111_0000 _dddd_pppp _==== _&&&&_xxxx_xxxx______dddd_eeee_vvvv_[[[[_gggg_eeee_tttt_mmmm_iiii_nnnn_oooo_rrrr_((((_dddd_eeee_vvvv_))))_]]]]_;;;;
- _1111_1111 _iiii_ffff _((((_cccc_oooo_pppp_yyyy_oooo_uuuu_tttt_((((_((((_cccc_aaaa_dddd_dddd_rrrr______tttt_))))_dddd_pppp_,,,, _aaaa_rrrr_gggg_,,,, _ssss_iiii_zzzz_eeee_oooo_ffff_((((_ssss_tttt_rrrr_uuuu_cccc_tttt _dddd_eeee_vvvv_iiii_cccc_eeee_))))_))))_))))
- _1111_2222 _rrrr_eeee_tttt_uuuu_rrrr_nnnn _((((_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT_))))_;;;;
- _1111_3333 _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
-
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _bbbb_cccc_oooo_pppp_yyyy(D3), _cccc_oooo_pppp_yyyy_iiii_nnnn(D3), _uuuu_iiii_oooo_mmmm_oooo_vvvv_eeee(D3), _uuuu_rrrr_eeee_aaaa_dddd_cccc(D3), _uuuu_wwww_rrrr_iiii_tttt_eeee_cccc(D3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-